Skip to content

Add Cratis.CodeAnalysis umbrella analyzer package#2313

Merged
woksin merged 2 commits into
mainfrom
feature/cratis-codeanalysis-package
Jun 21, 2026
Merged

Add Cratis.CodeAnalysis umbrella analyzer package#2313
woksin merged 2 commits into
mainfrom
feature/cratis-codeanalysis-package

Conversation

@woksin

@woksin woksin commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a single opt-in package for the Cratis Arc Roslyn analyzers. Following the move to keep analyzers out of the meta package, this gives consumers one place to turn on the full analyzer set — reference Cratis.CodeAnalysis and get all the ARC*/ARCCHR* diagnostics, without having to add each analyzer package by hand.

Added

  • New Cratis.CodeAnalysis package that bundles the full set of Cratis Arc lint analyzers (ARC* and ARCCHR*). A single Cratis.CodeAnalysis reference enables them all; the individual Cratis.Arc.Core.CodeAnalysis and Cratis.Arc.Chronicle.CodeAnalysis packages remain available for à-la-carte use. The lint analyzers are still not bundled into the functional packages, so referencing Cratis.Arc.Core (or the Cratis meta package) does not force them on you.

Removed

  • The Cratis.Arc.Core.Generators package is no longer published. That source generator ships inside Cratis.Arc.Core (it emits AOT query metadata into the consuming assembly), so a standalone copy was redundant and referencing both at once failed the build with CS0101.

woksin and others added 2 commits June 21, 2026 20:31
Bundle the full set of Cratis Arc lint analyzers (ARC*, ARCCHR*) into a single
package so a consumer can opt into all of them with one reference instead of
adding each analyzer package by hand. The individual Cratis.Arc.Core.CodeAnalysis
and Cratis.Arc.Chronicle.CodeAnalysis packages stay available for a-la-carte use.

Only lint analyzers are bundled here. Functional source generators (e.g. the
query-metadata generator) keep shipping with the package they serve and never
appear here, so the umbrella can never collide with a functional package's
generator. The package itself carries no dependencies (analyzer-only).

Verified end to end: a consumer referencing only Cratis.CodeAnalysis has both
analyzer assemblies handed to csc via /analyzer. A pack-inspect spec guards that
the package keeps bundling both lint analyzers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The query-metadata source generator already ships inside Cratis.Arc.Core, where
it emits AOT query metadata into the consuming assembly. Publishing it as a
standalone package too was redundant, and referencing both at once loaded the
same generator from two paths and failed the build with CS0101. Mark the project
non-packable; the in-repo build and Cratis.Arc.Core's own bundling are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@woksin woksin added the minor label Jun 21, 2026
@github-actions

Copy link
Copy Markdown

NuGet packages for this PR, e.g. Cratis.Arc:
https://github.com/cratis/arc/packages/1655206?version=20.47.0

public void should_bundle_the_arc_and_chronicle_lint_analyzers()
{
var repositoryRoot = GetRepositoryRoot();
var workingDirectory = Path.Combine(Path.GetTempPath(), "Cratis.CodeAnalysis.Package.Integration", Guid.NewGuid().ToString("N"));
{
var repositoryRoot = GetRepositoryRoot();
var workingDirectory = Path.Combine(Path.GetTempPath(), "Cratis.CodeAnalysis.Package.Integration", Guid.NewGuid().ToString("N"));
var packageDirectory = Path.Combine(workingDirectory, "packages");
Directory.CreateDirectory(packageDirectory);
RunDotNet(
repositoryRoot,
$"pack \"{Path.Combine(repositoryRoot, "Source", "DotNET", "Cratis.CodeAnalysis", "Cratis.CodeAnalysis.csproj")}\" -c Release --output \"{packageDirectory}\" -p:IncludeSymbols=false -p:IncludeSource=false");

while (current is not null)
{
if (File.Exists(Path.Combine(current.FullName, "Arc.slnx")))
@woksin woksin merged commit 5bd2b9c into main Jun 21, 2026
50 checks passed
@woksin woksin deleted the feature/cratis-codeanalysis-package branch June 21, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant